<?php echo $this->Html->css('form'); ?>
<?php echo $this->Html->css('add_category'); ?>
<?php echo $this->Html->script('ckeditor/ckeditor'); ?>

<?php
$myControl = $this->params["controller"];
$myAction = $this->params["action"];

$cont = Inflector::classify($myControl);
$act = Inflector::camelize($myAction);
?>
<?php echo $this->Form->create('New',array('url'=>'/news/add','id' => "{$cont}{$act}Form",'enctype' => 'multipart/form-data'));?>

<div class="contentMain">
<div class="grayBox">

<div class="form_wrapper">
    <div class="title">Add a new story</div>
    <ul class="addBox">
        <li>
            <span class="titleName"><label>Website</label></span>
            <?php
                echo $form->text('site', array(
                    'required' => 'required',
                    'placeholder' => 'Website name'));
                echo '&nbsp;';
                echo $form->error('site',array('class'=>'error-message'));
            ?>
        </li>
        <li>
            <span class="titleName"><label>Url</label></span>
            <?php
                echo $form->text('url', array(
                    'required' => 'required',
                    'placeholder' => 'News link',
                    'style' => 'width:500px'));
                echo '&nbsp;';
                echo $form->error('url',array('class'=>'error-message'));
            ?>
        </li>
        <li>
            <span class="titleName"><label>Title</label></span>
            <?php
                echo $form->text('title', array(
                    'required' => 'required',
                    'placeholder' => 'Displayed title'));
                echo '&nbsp;';
                echo $form->error('title',array('class'=>'error-message'));
            ?>
        </li>
        <li>
            <span class="titleName"><label>Content</label></span>
            <?php
                echo $form->textarea('content', array(
                    'id' => 'manufacturer_desc'
                ));
                echo '&nbsp;';
                echo $form->error('content',array('class'=>'error-message'));
            ?>
        </li>
    </ul>
    <?=$this->Form->button(__('Save and publish', true), array('type' => 'submit', 'id'=>'save_publish','name'=>'savePublish', 'class'=>'btn')); ?>
    <a href="<?=$this->webroot.Controller::referer()?>" class="btn" style="text-decoration:none">Cancel</a>
</div>

</div>
</div>

<?php
echo $this->Form->end();
?>
<script>
CKEDITOR.replace( 'manufacturer_desc',
    {
        extraPlugins : 'uicolor',
        toolbar : [ ['Bold', 'Italic'], ['NumberedList'], ['Link', 'Unlink'] ],
        width: '400px'
    });
CKEDITOR.on("instanceReady", function(){
    $('#cke_manufacturer_desc').css('margin-left', '25.5%').css('margin-top', '-20px');
});
</script>
